<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
</script>

<template>
  <header>
    <nav>
      <h1 class="sub-title"><RouterLink to="/">涛哥编程网</RouterLink></h1>
      <div class="sub-nav">
        <ul class="sub-nav-first">
          <li>咨<RouterLink to="/login">询热</RouterLink>线：18810312041</li>
        </ul>
        <ul class="sub-nav-second">
          <RouterLink to="/"><li>首页</li></RouterLink>
          <RouterLink to="/list"><li>技术文章</li></RouterLink>
          <RouterLink to="/grid"> <li>项目实战</li></RouterLink>
          <RouterLink to="/music"><li>休闲娱乐</li></RouterLink>
          <RouterLink to="/about"><li>关于我们</li></RouterLink>
          <li></li>
        </ul>
      </div>
    </nav>
  </header>
  <div class="content">
    <router-view v-slot="{ Component }">
      <keep-alive include="list-component">
        <component :is="Component" />
      </keep-alive>
    </router-view>


  </div>
</template>

<style scoped>
header {
  height: 9vh;
  background-color: white;
  border-bottom: 1px solid white;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10;
  box-shadow: 0 1px 20px gainsboro;
}

nav {
  width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: space-between;
}

.sub-title {
  height: 9vh;
  line-height: 9vh;
}

.sub-title a {
  color: black;
}
.sub-nav {
  height: 9vh;
  width: 30vw;
}

.sub-nav-first {
  height: 4vh;
  line-height: 4vh;
  display: flex;
  justify-content: flex-end;
}

.sub-nav-first li {
  float: left;
  min-width: 5vw;
  font-size: 0.8rem;
  background-color: white;
}

.sub-nav-second {
  height: 4vh;
  display: flex;
}

.sub-nav-second li {
  min-width: 5vw;
  line-height: 5vh;
  font-weight: bold;
  font-size: 0.9rem;
  text-align: center;
}
.sub-nav-second li:hover {
  border-bottom: 0.2rem solid #e0575b;
  cursor: pointer;
}

.content {
  width: 1280px;
  display: flex;
  flex-direction: column;
  justify-content: left;
  background-color: white;
  padding-top: 9vh;
}
</style>
